package com.funny.stock.base.vo;

/**
 * @author pengl
 * @date 2020/05/23
 **/
public enum TradeType {

    BUY(0),

    SELL(1);

    int type;

    TradeType(int type){
        this.type = type;
    }

    public int getType() {
        return type;
    }

    public static TradeType of(int type){
        TradeType[] values = values();
        for (int i = 0; i < values.length; i++) {
            if(type == values[i].getType()){
                return values[i];
            }
        }

        return null;
    }
}
